URLs - What Are They And How To Use Them

 

Introduction.

A URL (Uniform Resource Location) is an address for something you can access on the Internet. Usually the address will be a webpage. For example, http://www.sausagetools.com/index.html is a URL. Most browsers have the http:// as a given, so you could just enter www.sausagetools.com/index.html. However, URLs don’t have to point to webpages. For instance, the URL:

http://www.sausagetools.com/graphics/logos/sausage_silver_white_type_300x140.jpg

points to an image.

Special Rules

There is a special webpage name you can use called index.HTML (or index.htm). This webpage name is the default webpage that browser will display if no webpage is specified in the URL. For instance, if you enter www.sausagetools.com into your browser, you will see Sausage Software’s home page. What you are actually seeing is http://www.sausagetools.com/index.htm. Now you are designing your own webpages, you can take advantage of this fact. The index.HTML page is your welcome page. It should be used as a jumping off point for all your other webpages.

Example

When HotDog asks you for a URL, it is asking for the address of some resource on the Internet. This could be a webpage, image or sound. All you have to do is know what the address is and you can link to it.

For example, say you wanted to link to a band, They Might Be Giants. First of all you need to find the address for their website. In the course of your searching you come across a webpage and decide that this is the page you want to link to. Now you must find the URL or address of the webpage. Usually, somewhere near the top of your browser, there is a box displaying the address of the page you are viewing:

Typical Browser showing URL The URL is http://www.tmbg.com/. Note, the last slash is not necessary but is technically correct. You will notice if you follow any of the links in the site, the address will change. For instance, if you follow the melody link (animation of a turning record), the URL becomes http://www.tmbg.com/melody/index.html. An exact break down of the URL is possible. The webpage pointed to by the melody link is called index.HTML and is stored in the melody directory on their server. Because the filename is index.HTML, you could just enter the address http://www.tmbg.com/melody/ and you would see the same webpage.

Inserting a Link to Another webpage.

Now you know the URL of the webpage, inserting a link to the URL from your own webpage is easy.

  1. On the Insert menu, select Insert Hyperlink. This will bring up the Insert Hyperlink dialog.

  2. In the URL field, enter the URL of the They Might Be Giants Website: http://www.tmbg.com

  3. In the description field, enter the words that the viewer should click on to link to the They Might Be Giants website. For example, you could enter the word here into the description field. The result would look something like this on the visitor’s browser:

Click here to visit this great website.

 TIPS

Sometimes you will follow a link to a webpage but will be unable to find the introduction to the whole website (the homepage). Often you can find this page by directly entering obvious URLs yourself.

Example:

You are at the webpage: http://www.dummyname.com/download/downloadpage.HTML

If you wanted to try and find the welcome page to this site (i.e., the index.HTML page), try entering the following URLs into your browser:

  • http://www.dummyname.com

  • http://www.dummyname.com/download

In all likelihood, one of the above URLs would have the information you need.

URLs in HTML

Now you know what a URL is, how do you insert one in HTML?

The basic HTML syntax for a URL is:

<A HREF="http://www.sausagetools.com/">Text to click on</A>

The <A> tag (Anchor) sets up the beginning of the URL. The HREF (Hypertext Reference) attribute inside the <A> tag defines the address of the URL. Note how the text to click on is managed. It is inserted between <A HREF="....."> and </A>. That is, it is between the opening and closing Anchor tags. Any text you insert between <A>and </A> can be clicked on to link to the specified URL. In fact, if you look at the code that changes images into links, you will see it is just an extension of this principle. For example, if you have an image called sausage_logo in your graphics directory, then the code could look something like:

<A HREF="http://www.sausagetools.com/">

<IMG SRC="graphics/sausage_logo.jpg">

</A>

Put simply, the image has been placed between <A>and </A> (that is, it has been wrapped by the URL), and can now be clicked on to link to the Sausage Software website.